package book;

public class Book {
    private String name;//书名
    private String author;//作者
    private String type;//类型
    private int price;//价格
    private  boolean isBorrowed;//是否被借出 默认false


    public Book(String name,String author,String type,int price) {
        this.name = name;
        this.author = author;
        this.price = price;
        this.type = type;
    }
    public String getName(){
        return this.name;
    }
    public void setName(String name){
        this.name=name;
    }
    public String getAuthor(){
        return this.author;
    }
    public void setAuthor(String author){
        this.author=author;
    }
    public String getType(){
        return this.type;
    }
    public void setType(String type){
        this.type=type;
    }
    public int getPrice(){
        return this.price;
    }
    public void setPrice(int price){
        this.price=price;
    }
    public boolean isBorrowed(){
        return this.isBorrowed;
    }
    public void setBorrowed(boolean borrowed){
        this.isBorrowed=borrowed;
    }

    @Override
    public String toString() {
        return "BookList{" +
                "name='" + name + '\'' +
                ", author='" + author + '\'' +
                ", type='" + type + '\'' +
                ", price=" + price +
                ((isBorrowed == true) ? "  已借出" : "  未借出")+
                '}';
    }

}
